<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>新增商机</title>
    <link rel="icon" href="favicon.ico" type="images/ico">
    <meta name="author" content="dc">
    <link href="/css/bootstrap.min.css" rel="stylesheet" />
    <link href="/css/materialdesignicons.min.css" rel="stylesheet" />
    <link href="/css/animate.min.css" rel="stylesheet" />
    <link href="/css/style.min.css" rel="stylesheet" />
    <link href="/js/bootstrap-table/bootstrap-table.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="/js/jquery-confirm/jquery-confirm.min.css" />
    <link rel="stylesheet" href="/css/input_tags.css" />
    <!--时间选择插件-->
    <link rel="stylesheet" href="/js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.css" />
    <!--日期选择插件-->
    <link rel="stylesheet" href="/js/bootstrap-datepicker/bootstrap-datepicker3.min.css" />
    <link rel="stylesheet" href="/css/input_tags.css" />
    <!-- 多选下拉 -->
    <link rel="stylesheet" href="/css/bootstrap-multiselect.css" type="text/css"/>
    <link rel="stylesheet" href="/css/bootstrap-select.css" type="text/css"/>
    <link rel="stylesheet" href="/css/skin.css" />
    <link rel="stylesheet" href="/css/opportunityManager/user/userOpportunityDetail.css">
    <script th:inline="javascript">
        var addOpportunityQO = [[${addOpportunityQO}]];
        // customer.tag = customer.tag.split(',');
        console.log(addOpportunityQO);
    </script>
</head>
<body>
<div class="container-fluid">
    <div class="card">
        <div class="card-header">
            <h1 id="title">新增商机</h1>
        </div>
        <div class="card-body">
            <form class="well form-well" id="addOpportunityModel">
                <span id="opportunityBs" class="hidden" th:text="${addOpportunityQO.opportunityBs}"></span>
                <span id="contactIdAdd" class="hidden" th:text="${addOpportunityQO.contactId}"></span>
                <span id="customerIdAdd" class="hidden" th:text="${addOpportunityQO.customerId}"></span>
                <span id="customerName" class="hidden" th:text="${addOpportunityQO.customerName}"></span>
                <h2>基本信息</h2>
                <div class="row">
                    <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12">
                        <label class="control-label label-required" for="opportunityTitle">商机名称</label>
                        <div class="form-content">
                            <input id="opportunityTitle" type="text" class="form-control">
                        </div>
                    </div>
                    <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                        <label class="control-label label-required" for="opportunitySource">商机来源</label>
                        <div class="form-content">
                            <input maxlength="20" id="opportunitySource" type="text" class="form-control" placeholder="请输入商机来源">
                        </div>
                    </div>
                    <div class="col-lg-4 col-md-6 col-sm-6 col-xs-12" id="customerIdHide">
                        <label class="control-label label-required" for="customerId">客户名称</label>
                        <div class="form-content">
                            <select class="form-control" id="customerId" type="text" title="请选择" data-live-search="true">
                                <option>数据加载中，请稍后...</option>
                            </select>
                        </div>
                    </div>
                    <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12" id="contactIdHide">
                        <label class="control-label label-required" for="contactId">客户联系人</label>
                        <div class="form-content">
                            <select class="form-control" id="contactId" type="text" title="请选择" data-live-search="true" disabled>
                            </select>
                        </div>
                    </div>
                    <!--<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                        <label class="control-label label-required" for="opportunityContact">联系方式</label>
                        <div class="form-content">
                            <input maxlength="20" id="opportunityContact" type="text" class="form-control">
                        </div>
                    </div>-->
                    <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                        <label class="control-label label-required" for="contactPosition">联系人职务</label>
                        <div class="form-content">
                            <select name="contactPosition" id="contactPosition" title="请选择" class="form-control">
                                <!--<option value="0">公司管理</option>
                                <option value="1">财务</option>
                                <option value="2">人力</option>
                                <option value="3">其他</option>-->
                                <option value="财务副总裁/财务总经理">财务副总裁/财务总经理</option>
                                <option value="财务总监/总会计师">财务总监/总会计师</option>
                                <option value="审计及证券">审计及证券</option>
                                <option value="财务经理/财务处长/财务部长">财务经理/财务处长/财务部长</option>
                                <option value="财务主管/财务科长">财务主管/财务科长</option>
                                <option value="办公室及人资">办公室及人资</option>
                                <option value="会计及出纳">会计及出纳</option>
                                <option value="其他">其他</option>
                            </select>
                        </div>
                    </div>
                    <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                        <label class="control-label label-required" for="opportunityTp">商机类型</label>
                        <div class="form-content">
                            <select name="opportunityTp" id="opportunityTp" title="请选择" class="form-control">
                                <option value="">请选择</option>
                                <option value="1">续费</option>
                                <option value="2">新会员</option>
                                <option value="3">单次</option>
                                <option value="4">证书</option>
                                <option value="5">线上单品</option>
                                <option value="6">高端班</option>
                                <option value="7">内训</option>
                                <option value="8">咨询</option>
                                <option value="9">组合</option>
                                <option value="10">行业会</option>
                                <option value="11">其他</option>
                            </select>
                        </div>
                    </div>
                    <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
                        <label class="control-label label-required" for="estimatedSalesAmount">预计销售金额</label>
                        <div class="form-content">
                            <input maxlength="20" id="estimatedSalesAmount" type="text" class="form-control" placeholder="请输入预计销售金额" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,4})?).*$/g, '$1')">
                        </div>
                    </div>
                </div>
            </form>
            <div class="well form-well opportunity">
                <h2>商机产品</h2>
                <button type="button" class="btn btn-success btn-label" data-toggle="modal" data-target="#addProductModal"><label><i class="mdi mdi-plus"></i></label>新增产品</button>
                <table id="opportunityProduct"></table>
                <!--<div class="row row-price" style="max-width: none;">
                    <div class="col-xs-6">总折扣：<strong id="discount"></strong></div>
                    <div class="col-xs-6 text-right">总计价：<strong id="totalPrice"></strong></div>
                </div>-->
            </div>
            <div class="form-actions">
                <button class="btn btn-primary btn-label" type="button" onclick="saveOpportunity()"><label><i class="mdi mdi-check"></i></label>确定</button>
                <button class="btn btn-default" type="button" onclick="cancelAddOpportunity();">重置</button>
            </div>
        </div>
    </div>
</div>
<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" id="addProductModal">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h4>添加产品</h4>
            </div>
            <div class="modal-body">
                <ul class="nav nav-tabs select-switch pull-left" role="tablist" id="productTab">
                    <li role="presentation" class="active"><a href="#member" aria-controls="member" role="tab" data-toggle="tab">会员</a></li>
                    <li role="presentation"><a href="#nonmember" aria-controls="profile" role="nonmember" data-toggle="tab">非会员</a></li>
                </ul>
                <div class="tab-content">
                    <div role="tabpanel" class="tab-pane active" id="member">
                        <div class="input-group m-b-10 w-30 pull-right">
                            <input type="text" class="form-control" placeholder="请输入会员产品名称" id="searchMemberProductName" autocomplete="off">
                            <span class="input-group-btn"><button type="button" class="btn btn-default" id="memberProductSearch">搜索</button></span>
                        </div>
                        <table id="memberProductListTable"></table>
                    </div>
                    <div role="tabpanel" class="tab-pane" id="nonmember">
                        <div class="input-group m-b-10 w-30 pull-right">
                            <input type="text" class="form-control" placeholder="请输入非会员产品名称" id="searchNomemberProductName" autocomplete="off">
                            <span class="input-group-btn"><button type="button" class="btn btn-default" id="nomemberProductSearch">搜索</button></span>
                        </div>
                        <table id="nomemberProductListTable"></table>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" onclick="addProductRow();">确定</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>


</body>
<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="/js/main.min.js"></script>
<script type="text/javascript" src="/js/bootstrap-table/bootstrap-table.min.js"></script>
<script type="text/javascript" src="/js/bootstrap-table/bootstrap-table-zh-CN.min.js"></script>
<script src="/js/jquery-confirm/jquery-confirm.min.js"></script>
<script src="/js/crm/common/city.js"></script>
<!--公共js-->
<script src="/js/crm/common/common.js"></script>
<script src="/js/crm/common/input-tag.js"></script>
<!--时间选择插件-->
<script src="/js/bootstrap-datetimepicker/moment.min.js"></script>
<script src="/js/bootstrap-datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script src="/js/bootstrap-datetimepicker/locale/zh-cn.js"></script>
<!--日期选择插件-->
<script src="/js/bootstrap-datepicker/bootstrap-datepicker.min.js"></script>
<script src="/js/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js"></script>
<!-- 多选框下拉 -->
<script type="text/javascript" src="/js/bootstrap-select.js"></script>
<script type="text/javascript" src="/js/bootstrap.lyear.dropdowntree.min.js"></script>
<script src="/js/crm/opportunityManager/addOpportunity.js"></script>
</html>
